package org.jet.emall.prod.transfer;

import org.jet.emall.prod.dto.NewSpuDTO;
import org.jet.emall.prod.dto.SpuViewDTO;
import org.jet.emall.prod.model.NewSpuModel;
import org.jet.emall.prod.vo.SpuViewVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-04-15 10:10
 */
@Mapper
public interface SpuVoTransfer {

    SpuVoTransfer INSTANCE = Mappers.getMapper(SpuVoTransfer.class);


    /**
     *   将SPU的DTO列表转成VO列表
     * @param list
     * @return
     */
    List<SpuViewVO> toVoList(List<SpuViewDTO> list);

    /**
     *  将SPU 的DTO 转VO
     * @param spuDTO
     * @return
     */
    SpuViewVO toVo(SpuViewDTO spuDTO);

    /**
     *   将新增的SPU 模型 转 DTO
     * @param spuModel
     * @return
     */
    NewSpuDTO toDto(NewSpuModel spuModel);

}
